#include "Commom.hpp"

int main(){
    int shm_id = CreateShareMem();//创建共享内存
    
    char* shmaddr = (char*)shmat(shm_id, nullptr, 0);//挂挂接共享内存

    //读取消息，可以配合管道进行同步
    while(true){
        std::cout << "ShareMenSend say@" << shmaddr << std::endl;

        sleep(1);
    }

    shmdt(shmaddr);//挂接分离

    shmctl(shm_id, IPC_RMID, nullptr);//删除共享内存

    return 0;
}